using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ShowMouseUI : MonoBehaviour
{
    private Camera main_camera;

    Text text_comp;
    void Start()
    {
        main_camera = Camera.main;
    }

    // Update is called once per frame
    void Update()
    {
        var mouse_position = Input.mousePosition;



        if (Input.GetKeyDown(KeyCode.X))
        {
            // BdUtils.log(" GetUGUIForScreenPos --- ", BdTools.UITools.get_ui_position_by_screen_position(Input.mousePosition));
            BdUtils.log(" GetUGUIForScreenPos --- ", BdTools.UITools.get_ui_object_on_position(Input.mousePosition));
            //     RaycastHit2D hit = Physics2D.Raycast(mouse_position + Vector3.up * 0.2f, lookDirection, 1.5f, LayerMask.GetMask("NPC"));
            //     if (hit.collider != null)
            //     {
            //         Debug.Log("Raycast has hit the object " + hit.collider.gameObject);

        }

        // if (Input.GetMouseButtonDown(0))
        // {
        //     Vector3 _mouse_position = main_camera.ScreenToWorldPoint(mouse_position);

        //     Vector3 _mouse_position_1 = main_camera.WorldToScreenPoint(_mouse_position);

        //     BdUtils.log(" --- mouse_position:", mouse_position, " | _mouse_position:", _mouse_position, " | _mouse_position_1:", _mouse_position_1);

        //     // var game_obj = BdTools.get_game_object_on_position(mouse_position);
        //     // var ui_obj = BdTools.UITools.get_ui_object_on_position(mouse_position);
        //     // // BdUtils.log(" --- game_obj:", game_obj, "| ui_obj:", ui_obj);


        //     // if (ui_obj)
        //     // {
        //     //     // RectTransformUtility.ScreenPointToWorldPointInRectangle(ui, pos, _camera_UiCamera, out worldPoint))
        //     //     BdUtils.log(" ---  ui_obj:", ui_obj.name, "| path:", BdTools.get_abs_path_by_obj(ui_obj));
        //     //     BdUtils.log(" ---  ui_obj.position 1:", ui_obj.transform.parent.parent.InverseTransformPoint(mouse_position));
        //     //     BdUtils.log(" ---  ui_obj.position 2:", ui_obj.transform.TransformPoint(mouse_position));
        //     // }
        // }

    }
}
